package by.dkusch.aircompany.model.tables;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import by.dkusch.aircompany.model.tables.base.BaseEntity;
import by.dkusch.aircompany.model.tables.enums.DaysOfWeek;

@Entity
public class TimeTable extends BaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	@NotNull
	@Size(max = 100)
	@Column
	private String code;

	@NotNull
	@ManyToOne(fetch = FetchType.LAZY, targetEntity = Route.class)
	@JoinColumn(name = "route_id")
	private Route route;

	@Column
	@Enumerated(EnumType.ORDINAL)
	@NotNull
	private DaysOfWeek dayOfWeek;


	@NotNull
	@Column
	private Date departureTime;

	@Column
	private Boolean constFl;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Route getRoute() {
		return route;
	}

	public void setRoute(Route route) {
		this.route = route;
	}

	public DaysOfWeek getDayOfWeek() {
		return dayOfWeek;
	}

	public void setDayOfWeek(DaysOfWeek dayOfWeek) {
		this.dayOfWeek = dayOfWeek;
	}

	public Date getDepartureTime() {
		return departureTime;
	}

	public void setDepartureTime(Date departureTime) {
		this.departureTime = departureTime;
	}

	public Boolean getConstFl() {
		return constFl;
	}

	public void setConstFl(Boolean constFl) {
		this.constFl = constFl;
	}


}
